<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            border: 1px solid red;
        }

        .d1 {
            /*固定定位 会脱落文档流占位 后面的元素会挤压上来*/
            /*针对的是当前窗口*/
            /*方向: left top bottom right*/
            position: fixed;
            left: 200px;
            top: 20px;
            bottom: 0px;
            right: 0px;
        }

        .d2 {
            background-color: rgba(0, 0, 0, .3);
            width: 20px;
            height: 1000px;
            position: fixed;
            right: 0px;
            top: 0px;
            border: none;
        }
    </style>
</head>
<body>
<div>div1</div>
<div class="d1">div2</div>
<div>div3</div>
<div class="d2">导航栏</div>
br*1000
</body>
</html>